package com.spark.gaea.security.utils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

public class CookieMap {
	public static Map<String, Cookie> ReadCookieMap(final HttpServletRequest request) {
		final Map<String, Cookie> cookieMap = new HashMap<String, Cookie>();
		final Cookie[] cookies = request.getCookies();
		if (null != cookies) {
			for (final Cookie cookie : cookies) {
				cookieMap.put(cookie.getName(), cookie);
			}
		}
		return cookieMap;
	}
}
